

# 59.螺旋矩阵


def SpiralMatrix(target):
    nums = [0*target]*target
    n = 0
    start = 0
    length = 1
    count = 1
    while(n<target/2):
        n = n + 1
        for j in range(start,target-length):
            nums[start][j] = count
            count = count + 1
        for i in range(start,target-length):
            nums[i][j] = count
            count = count + 1
        for m in range(target-length,start):
            nums[target-length][m] = count
            count = count + 1
        for n in range(target-length,start):
            nums[n][start] = count
            count = count + 1
        start = start + 1
        length = length + 2
    return nums

if __name__ == "__main__":
    target = int(input())
    num = SpiralMatrix(target)
    print(num)